\magnification = 2000 %\magstep3
\input amstex
\documentstyle{amsppt}
\input OurATOMacros
\input OurPlainGraphicsMacros


\cl{\cmrX \hglue -8pt  Implicit Surfaces or} 
\smallskip
\Title  \cmrX  Level Sets of Functions.

\vskip5pt
\centerline{\includegraphics[width=2in] {ImplicitSurfaces.png}}
\noindent
Surfaces in $\BR^3$ are either described as ``parametrized images''
 $F: D^2 \to \BR^3$ or as ``implicit surfaces'', i.e., as levels of  
functions $f:\BR^3 \to \BR$, as the set of points where $f$ has a fixed 
value $v$: $\{x\in\BR^3;\ f(x)=v\}$. 
\lf
One can more easily make images of parametrized surfaces than of
implicit surfaces, because every point $p\in D$ can be mapped with the
given function $F$ to obtain `explicitly' a point $F(p)$ of the surface.
Note however that the opposite problem: ``Given a point in $\BR^3$,
decide whether it lies on the surface'' does not have an easy answer.
For an implicit surface, on the other hand, it is easy to decide whether
a given point in $\BR^3$ is on the surface (simply check $f(x)=v$), but
no point is given explicitly, one has to
use some algorithm to find points $x\in \BR^3$ which satisfy $f(x)=v$.
\lf 
And even after one has found many points on the surface, how does one
connect them, what is a good way to represent the surface? The method
of {\it raytracing} has been invented as one solution. Choose some center
point $C$, think of it to be near the eyes of the viewer. Connect each
pixel of the screen with $C$ by a line and decide whether this line
meets the surface. Of all the intersection points on the line choose
the one closest to $C$, compute the normal of the surface at this
point $x$ (i.e. compute $\hbox{grad}f(x)$) and decide with this information
what light (from fixed light sources) will be reflected by the surface
at $x$ towards $C$. Color that pixel accordingly. In this way one 
produces an image which presents the surface as if it were an illuminated
object. The computation used to take very long, but with todays computers
such pictures can be computed while you wait, but not quite fast enough
for real time rotations. These pictures look very realistic, but of course
they show only what is visible from the viewer.
\lf
In 3D-XplorMath a second method is offered. Imagine that the surface
is intersected with random lines until around 10.000 points have been
found on the implicit surface. Then red-green stereo is used to project
these points to the screen. When viewing through stereo glasses we see
all these points in the correct position in space and our brain 
interpolates the picture and lets us see a surface in space. In this
representation all parts of the surface (within some viewing sphere)
can be seen, not just the front most portions. Since it is possible
to achieve a fairly uniform distribution of points on level surfaces,
one sees many points in the direction towards contours of the surface.
This emphasis of the contour points is so strong that one also gets
a fair impression of the surface if one does not look through red-green
glasses. This method is fast enough for real time rotations. \par
\vskip 2pt
\centerline{ \bf What Surfaces Can One See?}

\noindent
Of all the closed surfaces only spheres and tori have explicit
parametrizations. Therefore pictures of para\-metrized surfaces will
only show portions of a complicated surface (``patches'') or they
will show spheres and tori. By contrast, already fairly simple functions
may have level surfaces which are more complicated than tori, are so
called bretzel surfaces of genus $g > 1$.
\lf
How can one find such functions? As an example, consider two circles
of radius $r$, in the $x$-$y$-plane, with midpoints $\pm 1$ on the
$x$-axis. This set is described as the intersection of the plane
$g(x,y,z):=z = 0$ with the zero set of the function
$$h(x,y,z):= ((x-1)^2 + y^2 - r^2)\cdot((x+1)^2 + y^2 - r^2).$$
Now define
$$ f(x,y,z) := h(x,y,z)^2 + g(x,y,z)^2.$$
Clearly, the zero set of $f$ is the union of the two circles, which
is {\it not} a surface, because $\hbox{grad} f$ vanishes along this zero set.
However, most of the levels $\{(x,y,z); f(x,y,z) = v > 0 \}$ are
surfaces without singularities. If the two circles intersect ($r>1$), then
for very small $v$ the levels are the boundary of a thickening of 
the two circles, i.e., surfaces of genus 3. As $v$ increases either
the middle hole or the two outside holes close first (depending on $r$).
For large $v$ the level surfaces are (not completely round) spheres.
Each time such a topological change occurs we observe one special
surface, it is not smooth like the other levels, but has one or more
cone like singularities. 
\lf
If $r<1$ then for very small $v$ the levels are separate tori. Then
either the tori grow together to a genus 2 surface, or the holes of
the tori close first and later the two sphere like surfaces grow
together.
%\vfil\eject
%\vglue-10pt
\vskip5pt
\centerline{\bf Other Functions Supplied in 3D-XplorMath.}

\noindent
({\it Note:} One should always experiment with the level value $v$ of the
function $f$. For small values of $v$ one will see how the function was
designed. Most default morphs vary $v=ii$.)

\vglue -25pt
$$ \leqalignno{
& &\hbox{Genus 2, tube around a figure 8:} \cr
 f(x,y,z) :=& ((1-x^2)x^2 - y^2)^2 + z^2. & \cr
& & \hbox{Genus 5, tube around two intersecting ellipses:} \cr
 f(x,y,z) :=& ((x^2 + y^2/4 -1)\cdot(x^2/4 + y^2 -1))^2 + z^2. &\cr
& & \hbox{Genus 3, tube around circle and orthogonal ellipse:} \cr
 f(x,y,z) :=& ((x^2 + y^2 -1)^2 +(z-1)^2)\cdot  &\cr
            &(x^2/aa + (z-tr)^2 -1)^2 + y^2).   &\cr 
  & & \hbox{Genus 5, tube around three orthogonal circles:} \cr
 f(x,y,z) :=& ((x^2 + y^2 -1)^2 + z^2)\cdot  &\cr
            & ((y^2 + z^2 -1)^2 + x^2)\cdot  &\cr
            & ((z^2 + x^2 -1)^2 + y^2) .  &\cr 
}$$
\goodbreak
\vglue -35pt
$$ \leqalignno{
& & \hbox{Genus 5,13,17, tube around six circles on a cube:} \cr
 f(x,y,z) :=& ((x^2 + y^2 -cc^2)^2 +(z^2-1)^2)\cdot  &\cr
            & ((y^2 + z^2 -cc^2)^2 +(x^2-1)^2)\cdot  &\cr
            & ((z^2 + x^2 -cc^2)^2 +(y^2-1)^2).  &\cr  
}$$
\noindent
 H.K.



\bye
